package com.zimmur.common;

import com.zimmur.tools.PreciseCompute;

/**
 * 积分兑换
 * @author Administrator
 *
 */
public class PointConvert {
	private static final int convertRate = 20;
	/**
	 * 积分兑换抵扣金额
	 * @param point
	 * @return
	 */
	public static double pointToJe(int point){
		double retJe = PreciseCompute.div(point, convertRate, 2);
		return retJe;
		
	}
	
	/**
	 * 金额换算积分
	 * @param je
	 * @return
	 */
	public static int jeToPoint(double je){
		int point = (int)PreciseCompute.mul(je, convertRate);
		return point;
	}
	
	public static void main(String[] args) {
		int point = 325;
		double je = pointToJe(point);
		System.out.println("pointToJe="+je);
		System.out.println("jeToPoint="+jeToPoint(je));
	}
}
